home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3427 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: frco.com!usenet
  2. From: Jadam@tcmail.frco.com (Jim Adam)
  3. Newsgroups: comp.lang.c++
  4. Subject: Increasing size of fstream's buffer:  Useful?
  5. Date: 23 Jan 1996 22:08:59 GMT
  6. Organization: Fisher Rosemount Systems
  7. Message-ID: <4e3m9r$6cb@rolaids.frco.com>
  8. NNTP-Posting-Host: primrose.frco.com
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.93.11
  11.  
  12. Y'all,
  13.  
  14. My application does a bit of file writing/reading using the standard
  15. fstream classes.  I understand that I can change the size of the
  16. buffer used by these classes via the setbuf() member function.  
  17.  
  18. The real question is:  is this worth it?  I expect to do some
  19. profiling on my own, but I'd like to hear from anyone 
  20. who's tried this and/or has opinions on it.  Given modern "disk 
  21. caching" that happens at the operating system level, I wonder 
  22. if building a larger cache at the application level will have 
  23. any effect on performance or not.  Also, I'm still not sure 
  24. exactly how this streambuf is used internally.  So it's hard
  25. to predict what effect a larger buffer might have on performance.
  26.  
  27. (BTW:  By poking around, I discovered that the default cache used
  28. by fstream on my system is 512 bytes.  --I don't think there's
  29. any programmatic way to check the size of the cache at run-time,
  30. since the streambuf::blen() function is protected.)
  31.  
  32. Thanks,
  33. Jim
  34. Jadam@tcmail.frco.com
  35.  
  36.